from public.tools import *
from public.action import *
from public.testDATE import *

from selenium.webdriver.common.keys import Keys
testCase="DBshop022_删除商品管理品牌"
MC="苹果"
firefox=openB(adminurl)
adminlogin(firefox)
menu2(firefox,"商品管理","商品品牌")

# 1.点击“删除”按钮，确认删除，删除成功。
firefox.find_element_by_xpath("//tr/td[contains(.,'%s')]/following-sibling::td[4]/a[2]" % MC).click()

try:
    firefox.find_element_by_xpath("//tr/td[contains(.,'%s')]" % MC)
    writeLog("%s 测试失败"% testCase)
except:
    writeLog("%s 测试通过" % testCase)
    getPhoto(firefox)
firefox.quit()